package com.coursehub.progress.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * 学生资料复合主键类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class StudentMaterialId implements Serializable {
    
    private String userId;
    private String courseId;
    private String chapterId;
    private String materialId;
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StudentMaterialId that = (StudentMaterialId) o;
        return Objects.equals(userId, that.userId) && 
               Objects.equals(courseId, that.courseId) && 
               Objects.equals(chapterId, that.chapterId) && 
               Objects.equals(materialId, that.materialId);
    }
    
    @Override
    public int hashCode() {
        return Objects.hash(userId, courseId, chapterId, materialId);
    }
}